﻿<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
             x:Class="GreetingCreatorSample.App"
             >
    <Application.Resources>

        <DataTemplate x:Key="ImageTemplate">
            <Border BorderBrush="Black" BorderThickness="1">
                <Border BorderBrush="White" BorderThickness="1">
                    <Image Source="{Binding Content}" Stretch="Uniform" MaxHeight="100"/>
                </Border>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="WordTemplate">
            <Border BorderThickness="1,1,2,2" BorderBrush="Black">
                <Border Background="White">
                    <TextBlock Text="{Binding Content}" FontSize="20"/>
                </Border>
            </Border>
        </DataTemplate>

        <ControlTemplate x:Key="simpleButtonTemplate" TargetType="Button">
            <Grid x:Name="grid" Background="Transparent">
                <vsm:VisualStateManager.VisualStateGroups>
                    <vsm:VisualStateGroup x:Name="FocusStates">
                        <vsm:VisualState x:Name="Unfocused"/>
                        <vsm:VisualState x:Name="Focused"/>
                    </vsm:VisualStateGroup>
                    <vsm:VisualStateGroup x:Name="CommonStates">
                        <vsm:VisualState x:Name="MouseOver">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="content" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1" Value="1.2"/>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="content" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1" Value="1.2"/>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </vsm:VisualState>
                        <vsm:VisualState x:Name="Pressed">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="content" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.05" Value="0.9"/>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="content" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.05" Value="0.9"/>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </vsm:VisualState>
                        <vsm:VisualState x:Name="Disabled"/>
                        <vsm:VisualState x:Name="Normal"/>
                    </vsm:VisualStateGroup>
                </vsm:VisualStateManager.VisualStateGroups>
                <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
                    <ContentPresenter.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </ContentPresenter.RenderTransform>
                </ContentPresenter>
            </Grid>
        </ControlTemplate>

    </Application.Resources>    
</Application>

